1 <?php
2     include(
"../includes/config.php");
3     session_start();
4     
if(isset($_SESSION['manufacturer_login'])) {
5         
if($_SESSION['manufacturer_login'] == true) {
6             $id = $_SESSION[
'manufacturer_id'];
7             $query_selectManufacturer =
"SELECT * FROM manufacturer WHERE man_id='$id'";
8             $result_selectManufacturer = mysqli_query($con,$query_selectManufacturer);
9             $row_selectManufacturer = mysqli_fetch_array($result_selectManufacturer);
10             $query_selectOrder =
"SELECT * FROM orders ORDER BY order_id DESC LIMIT 5";
11             $result_selectOrder = mysqli_query($con,$query_selectOrder);
12         }
13         
else {
14             header(
'Location:../index.php');
15         }
16     }
17     
else {
18         header(
'Location:../index.php');
19     }
20 ?>
21 <!DOCTYPE html>
22 <html>
23 <head>
24     <title> Manufacturer: Home </title>
25     <link rel=
"stylesheet" href="../includes/main_style.css" >
26 </head>
27 <body>
28     <?php
29         include(
"../includes/header.inc.php");
30         include(
"../includes/nav_manufacturer.inc.php");
31         include(
"../includes/aside_manufacturer.inc.php");
32     ?>
33     <section>
34         Welcome <?php echo $_SESSION[
'sessUsername']; ?>
35         <article>
36             <h2>My Profile</h2>
37             <table
class="table_displayData">
38             <tr>
39                 <th>Name</th>
40                 <th>Email</th>
41                 <th>Phone</th>
42                 <th>Username</th>
43                 <th> Edit </th>
44             </tr>
45             <tr>
46                 <td> <?php echo $row_selectManufacturer[
'man_name']; ?> </td>
47                 <td> <?php echo $row_selectManufacturer[
'man_email']; ?> </td>
48                 <td> <?php echo $row_selectManufacturer[
'man_phone']; ?> </td>
49                 <td> <?php echo $row_selectManufacturer[
'username']; ?> </td>
50                 <td> <a href=
"edit_profile.php"><img src="../images/edit.png" alt="edit" /></a> </td>
51             </tr>
52         </table>
53         </article>
54         <article>
55             <h2>Recent Orders</h2>
56             <table
class="table_displayData" style="margin-top:20px;">
57             <tr>
58                 <th> Order ID </th>
59                 <th> Date </th>
60                 <th> Approved </th>
61                 <th> Status </th>
62                 <th> Details </th>
63             </tr>
64             <?php $i=
1; while($row_selectOrder = mysqli_fetch_array($result_selectOrder)) { ?>
65             <tr>
66             
67                 <td> <?php echo $row_selectOrder[
'order_id']; ?> </td>
68                 
69                 <td> <?php echo date(
"d-m-Y",strtotime($row_selectOrder['date'])); ?> </td>
70                 <td>
71                     <?php
72                         
if($row_selectOrder['approved'] == 0) {
73                             echo
"Not Approved";
74                         }
75                         
else {
76                             echo
"Approved";
77                         }
78                     ?>
79                 </td>
80                 <td>
81                     <?php
82                         
if($row_selectOrder['status'] == 0) {
83                             echo
"Pending";
84                         }
85                         
else {
86                             echo
"Completed";
87                         }
88                     ?>
89                 </td>
90                 <td> <a href=
"view_order_items.php?id=<?php echo $row_selectOrder['order_id']; ?>">Details</a> </td>
91             </tr>
92             <?php $i++; } ?>
93         </table>
94         </article>
95     </section>
96     <?php
97         include(
"../includes/footer.inc.php");
98     ?>
99 </body>
100 </html>


Gõ tìm kiếm nhanh...